
package com.sausageking.client.consumer.activity;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.sausageking.client.consumer.ui.MerchantView;
import com.sausageking.client.consumer.ui.MobileDealView;
import com.sausageking.client.mvp.BaseActivity;

public class MobileDealActivity extends BaseActivity
    implements
      MobileDealView.Presenter {

  @Inject
  private MobileDealView containerView;

  @Inject
  private MerchantView merchantView;

  @Override
  public void startActivity(AcceptsOneWidget containerWidget, EventBus eventBus) {
    processing();
    containerView.setPresenter(this);
    containerWidget.setWidget(containerView.asWidget());
    containerView.addMerchantView(merchantView);
    merchantView.getPresenter().setContainerPresenter(this);
    merchantView.getPresenter().load(getContext());
  }

  @Override
  public String mayStop() {
    return null;
  }

  @Override
  public void signout() {
    for (String cookieName : Cookies.getCookieNames()) {
      Cookies.removeCookie(cookieName);
    }
  }
}
